//
//  SSHandpickHeaderView.m
//  starspaceVR
//
//  Created by 曹端芹 on 17/9/13.
//  Copyright © 2017年 starspace. All rights reserved.
//

#import "SSHandpickHeaderView.h"
#import "NSString+Size.h"

@implementation SSHandpickHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void) setupUI {

    
    UIView *spear = [[UIView alloc] init];
    spear.backgroundColor = kRGBColor(244, 244, 244);
    [self addSubview:spear];
    [spear mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.mas_equalTo(self);
        make.height.mas_equalTo(10);
    }];
    
    UILabel *pickL = [[UILabel alloc] init];
    pickL.text = @"精选推荐";
    pickL.font = kFont(15);
    pickL.textColor = kRGBColor(38, 38, 38);
    [self addSubview:pickL];
    [pickL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(20);
        make.size.mas_equalTo(CGSizeMake(65, 20));
        make.top.mas_equalTo(spear.mas_bottom).mas_offset(5);
    }];
    
    UIView *line = [[UIView alloc] init];
    line.backgroundColor = kRGBColor(223, 45, 36);
    CGFloat lineW = [pickL.text widthWithFont:kFont(15) constrainedToHeight:20];
    
    [self addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(pickL);
        make.size.mas_equalTo(CGSizeMake(lineW, 2));
        make.top.mas_equalTo(pickL.mas_bottom).mas_offset(5);
    }];
    
    
}



@end
